package com.x.core.utils;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.x.core.domain.BaseIdEntity;

public class MyBatisPlusUtil {

    public static void save(BaseMapper baseMapper, BaseIdEntity baseIdEntity){
        if (baseIdEntity.getId() == null){
            baseMapper.insert(baseIdEntity);
        }
        else{
            baseMapper.updateById(baseIdEntity);
        }
    }

}
